package com.blb.dao.admin;

import com.blb.pojo.ProductType;

import java.sql.SQLException;
import java.util.List;

public interface ProductTypeDao {

    /**
     * 轮播图序号获取轮播图信息
     * @param name
     * @return
     */
    ProductType selectByName(String name) throws Exception;

    /**
     * 根据轮播图名称分页
     * @param page
     * @param size
     * @return
     */
    List<ProductType> selectPage(int page, int size) throws Exception;

    /**
     * 查询总条数
     * @return
     */
    int count() throws SQLException, ClassNotFoundException;

    /**
     * 插入
     * @param productType
     */
    void insert(ProductType productType) throws SQLException, ClassNotFoundException;

    /**
     * 根据id删除
     * @param id
     */
    void deleteById(int id) throws SQLException, ClassNotFoundException;


    /**
     * 批量删除
     * @param ids
     */
    void batchDelete(String[] ids) throws SQLException, ClassNotFoundException;

    /**
     * 根据id获取用户数据
     * @return
     */
    ProductType selectById(int id) throws Exception;

    /**
     * 修改轮播图
     * @param productType
     */
    void update(ProductType productType) throws SQLException, ClassNotFoundException;

    /**
     * 联查两个表
     * @return
     * @throws Exception
     */
    List<ProductType> selectAll() throws Exception;
}
